<template>
  <van-cell
      is-link to="/safe"
      title="当前账号"
      icon="user-o"
      :value="`${user?.userAccount}`"
  />
  <van-cell
      is-link to="/safe"
      title="手机号"
      icon="phone-o"
      :value="`${user?.phone.slice(0, 3)}******${user?.phone.slice(-2)}`"
  />

  <van-cell
      is-link to="/change/password"
      title="账号密码"
  >
    <template #icon>
      <svg-icon icon-name="icon-mima" class="left-icon"></svg-icon>
    </template>
  </van-cell>

</template>

<script setup lang="ts">

import {onMounted, ref} from "vue";
import {getCurrentUser} from "../services/user";
import SvgIcon from "../components/SvgIcon.vue";

const user = ref();
onMounted(async () => {
  user.value = await getCurrentUser();
})
</script>



<style scoped>
.left-icon{
  margin-top: 4px;
  margin-right: 4px;
}
</style>